package com.edu.app.model.wechat;

import com.edu.app.util.json.JsonUtil;

import lombok.Data;

import java.io.IOException;
import java.io.Serializable;

@Data
public class WxAccessToken implements Serializable {
  private static final long serialVersionUID = 8709719312922168909L;

  private String access_token;

  private int expires_in = -1;

  public static WxAccessToken fromJson(String json) throws IOException {
    return (WxAccessToken) JsonUtil.fromJson(json, WxAccessToken.class);
  }

  public String getAccess_token() {
    return access_token;
  }

  public void setAccess_token(String access_token) {
    this.access_token = access_token;
  }

  public int getExpires_in() {
    return expires_in;
  }

  public void setExpires_in(int expires_in) {
    this.expires_in = expires_in;
  }
}
